package com.neusoft.yuejian_6.model;

import com.neusoft.yuejian_6.javabean.Train;
import com.neusoft.yuejian_6.service.TrainService;

import java.util.List;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;


public class TrainModel {
    private Retrofit retrofit;

    public TrainModel() {
        retrofit = new Retrofit.Builder()
                .baseUrl("http://10.0.2.2/neu1_yuejian/index.php/Api/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    //培训列表
    public Call<List<Train>> getTrainlist(){
        TrainService trainService = retrofit.create(TrainService.class);
        return trainService.getTrainlist();
    }
    //培训详情
    public Call<Train> getTrainById(int train_id){
        TrainService trainService=retrofit.create(TrainService.class);
        return trainService.getTrainById(train_id);
    }

}
